package il.adscan.scan.json.impl;

import il.adscan.domain.Advertisement;
import org.jsoup.nodes.Element;

import java.util.concurrent.Callable;

public class AdScraper implements Callable<Advertisement> {

    private Element element;
    private final WinWinScanner2 winWinScanner2;

    public AdScraper(Element element, WinWinScanner2 winWinScanner2) {
        this.element = element;
        this.winWinScanner2 = winWinScanner2;
    }

    @Override
    public Advertisement call() throws Exception {
//        String linkAttr = element.attr("onclick");
//        String link = linkAttr.substring(linkAttr.indexOf("http"), linkAttr.indexOf("rnd") + 7);
//        Advertisement advertisement = winWinScanner2.getAdvertisementFromLink(link);
//        advertisement.setTimeAdded(element.select(".reddate").html());
        return null;
    }
}
